Index your Salesforce B2C Commerce content with Algolia.
ContentSearchModel
) to browse content assets.
This is why the job has two steps: SFCCContentSearchIndex
and algoliaContentIndex
. Job first refreshes the SFCC content search index before extracting content assets and sends them to Algolia.
attributeList
parameter.
By default, the content indexing job sends the following attributes to Algolia: id
, name
, description
, url
, body
, page
, and algolia_chunk_order
.
Unlike for the product indexing jobs where there is a Custom Preference for defining defaults (that can be overridden per job), content attributes sent to Algolia are only configured at the job level by utilizing the attributeList
parameter.
<script>
tag, as indexing content from these tags is not meaningful for search purposes.attributeList
.
Attribute | Description |
---|---|
id | Content Asset or Page ID (on Salesforce B2C) |
objectId | A unique identifier on Algolia’s side for the Content Asset or Page (id + "_" + algolia_chunk_order ) |
algolia_chunk_order | Used for sorting chunks that belong to the same content asset/page |
name
, description
, url
, body
, and page
. Expand this list as needed for your use case (for example, pageTitle
).
Attribute | Description |
---|---|
name | The name of the content asset or page |
description | A description of the content asset or page |
url | The URL that provides access to the page or content asset |
body | The primary content displayed to users on the storefront |
page | Indicates whether the item is a (Page Designer) page (true if so) |
classificationFolder | The classification folder for the content (not applicable for Page Designer pages if the page is not assigned to a folder) |
pageDescription | A description metadata field, often used for SEO purposes |
pageKeywords | A list of keywords, often used for SEO purposes but potentially also useful for site search |
pageTitle | A page title, used for SEO purposes and to define the browser’s page title |
template | Applied for rendering content on Salesforce B2C |
algolia_chunk_order
and objectId
from the attributes being sent. However, you can specify which attributes should always be included by using defaultAttributes
in cartridges/int_algolia/cartridge/scripts/algolia/lib/algoliaContentConfig.js
.
indexOnlySearchables
boolean flag in pageDesignerHelper.js.
If indexOnlySearchables
is set to false, all attributes are indexed without the need for developer support for marking an attribute as searchable, if the page is marked as searchable in the Business Manager (BM).
Parameter | Description |
---|---|
attributeList | A comma-separated list of attributes to be indexed. |
failureThresholdPercentage | The maximum percentage of records allowed to have errors during indexing. For example, if the threshold is 10%, the indexing job fails if more than 10% of your records have an error during indexing. The temporary index will not be moved to production if the failure rate exceeds this threshold. The default is 0%. |
splittingTag | The HTML tag used for splitting content asset records into chunks. Without specifying this delimiter tag, there will be no semantic splitting, but only record size-based splitting. Example: h1 |
includedContent | Defines the indexing scope: allContents indexes both content assets and Page Designer components, contentAssets exclusively indexes content assets, and pageDesignerComponents indexes only the page designer components. |
body
. Page Designer pages are more complex, as they can consist of multiple regions and components, each with several attributes.
The structure of pages, regions, and components is adaptable. To effectively manage this structure, the cartridge uses the pageDesignerHelper.js
file, which helps you optimize extracting data from a single page.
pageDesignerHelper.js
utilizes a recursive approach to effectively manage and structure the hierarchical, tree-like data. For a comprehensive overview, see Salesforce’s Page Designer documentation.